package cn.iocoder.yudao.module.testequipment.dal.mysql.testequipment;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.testequipment.dal.dataobject.testequipment.TestEquipmentDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import cn.iocoder.yudao.module.testequipment.controller.admin.testequipment.vo.*;

/**
 * 参试设备管理表 Mapper
 *
 * @author wwwhk
 */
@Mapper
public interface TestEquipmentMapper extends BaseMapperX<TestEquipmentDO> {

    default PageResult<TestEquipmentDO> selectPage(TestEquipmentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TestEquipmentDO>()
                .likeIfPresent(TestEquipmentDO::getEqName, reqVO.getEqName())
                .eqIfPresent(TestEquipmentDO::getModel, reqVO.getModel())
                .eqIfPresent(TestEquipmentDO::getUseStatus, reqVO.getUseStatus())
                .eqIfPresent(TestEquipmentDO::getTestStatus, reqVO.getTestStatus())
                .orderByAsc(TestEquipmentDO::getId));
    }
    
    /**
     * 查询我的设备使用记录（已出库）
     * 
     * @param page 分页参数
     * @param reqVO 查询条件
     * @return 设备使用记录分页结果
     */
    IPage<TestEquipmentMyUseRespVO> selectMyEquipmentUsePage(IPage<TestEquipmentMyUseRespVO> page, @Param("reqVO") TestEquipmentPageReqVO reqVO);

}